home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / Mac OS USB DDK_v1.0.1 / UserStartup•USBDDK < prev   
Encoding:
Text File  |  1998-09-03  |  5.0 KB  |  138 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        UserStartup•USBDDK
  3. #
  4. #    Contains:    Project startup file for USBDDK
  5. #
  6. #    Modified by:    Craig Keithley
  7. #
  8. #    Version:    xxx put version here xxx
  9. #
  10. #    Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  11. #
  12.  
  13. # Various script variables
  14.  
  15. Set USBDDKOLDDir `Directory`
  16. Directory "{MPW}"
  17. Directory ::
  18. Set ROOT `Directory`
  19. Directory "{USBDDKOLDDir}"
  20.  
  21.  
  22. # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  23. # The following variables set the visible items of the BBS menu. Set nonzero value to disable item.
  24.  
  25. Set BBSMenu_NoBBSHelpItem                1; 
  26. Set BBSMenu_NoConfigureBBSItem            0; 
  27. Set BBSMenu_NoInitializeBBSItem            1; 
  28. Set BBSMenu_NoSetSourceDirItem            0; 
  29. Set BBSMenu_NoShowSourceItem            1; 
  30. Set BBSMenu_NoUpdateExistingSourcesItem    1; 
  31. Set BBSMenu_NoUpdateMPWItem                1; 
  32. Set BBSMenu_NoUpdateObjectsItem            1; 
  33. Set BBSMenu_NoUpdateWorkingSourcesItem    1; 
  34. Set AddSourcesMenu 0;
  35. Set ProjectHeaders 1;
  36.  
  37. # Export the variables so BBS can see them.
  38.  
  39. Export BBSMenu_NoBBSHelpItem;
  40. Export BBSMenu_NoConfigureBBSItem;
  41. Export BBSMenu_NoInitializeBBSItem;
  42. Export BBSMenu_NoSetSourceDirItem;
  43. Export BBSMenu_NoShowSourceItem;
  44. Export BBSMenu_NoUpdateExistingSourcesItem;
  45. Export BBSMenu_NoUpdateMPWItem;
  46. Export BBSMenu_NoUpdateObjectsItem;
  47. Export BBSMenu_NoUpdateWorkingSourcesItem;
  48. Export AddSourcesMenu;
  49. Export ProjectHeaders; 
  50.  
  51. # ••••••••••••••••••••••••
  52. # Whether symbols will be turned on in our code will now be saved in a variable at the top level called USBDDKSymbols. The default
  53. # value will be "-sym on" and "-mbg full".
  54.  
  55. set USBDDKSymbols "-sym on"
  56. set USBDDKMBGSymbols "-mbg on"
  57. set USBDDKDebugFlag 0
  58. set DebugBuild 0
  59. set USBDDKEngrBuild 1
  60.  
  61. Export USBDDKSymbols;
  62. Export USBDDKMBGSymbols;
  63. Export USBDDKDebugFlag;
  64. Export USBDDKEngrBuild;
  65.  
  66.  
  67. # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  68. # Define the local folder of where the sources are.
  69.  
  70. Set USBDDKFldrLocation "USB DDK Location";
  71.  
  72. If  ¬ "{USBDDKFolder}" && "`Exists "{ShellDirectory}{USBDDKFldrLocation}"`"    # If the USBDDKFolder var doesn't exist and the file does
  73.     Set USBDDKFolder "`Catenate "{ShellDirectory}{USBDDKFldrLocation}"`"    # Change the filename and...
  74.     Set sources "`Catenate "{ShellDirectory}{USBDDKFldrLocation}"`"                # set sources or BBS scripts will have trouble
  75. End
  76.  
  77.  
  78. If ¬ "`Exists "{ShellDirectory}{USBDDKFldrLocation}"`" || ¬ "`Exists "{USBDDKFolder}"`"        # If the USBDDKFldrLocation location dir file doesn't exist OR # the USBDDKFolder variable has not been set.....
  79.     Set NewWindowRect 5,5,100,300;                                                        # Create a rect for a window.
  80.     Set exit 0;
  81.     Set USBDDKTemp "{ShellDirectory}:";                                                # set a temp directory.
  82.     Loop; ∂
  83.                                                                                         # Get the file from the user.
  84.         Set USBDDKTemp "`(GetFileName "{ShellDirectory}:" -q -d -b "USBDDK" -m "Where is the 'USBDDK' folder?")≥dev:null`"; ∂
  85.         If "{USBDDKTemp}" != "";                                                    # If the file is non-empty
  86.             Echo -n "{USBDDKTemp}" > "{ShellDirectory}{USBDDKFldrLocation}";     # Replace the folder name with the new one.
  87.             Set USBDDKFolder "{USBDDKTemp}";                                    # Set the USBDDKFolder to that new location.
  88.             Break;                                                                        # bail
  89.         Else;     
  90.             Echo "## Warning: not creating file “{USBDDKFldrLocation}”.";             # else tell the user we are not creating a new file.
  91.             Unset USBDDKTemp USBDDKFldrLocation;                                # unset the temp variable.
  92.             Exit 2;                    
  93.         End; ∂
  94.     End; ∂
  95.     Set exit 1 ;
  96. End;
  97. Unset USBDDKTemp;                                                                    # Clear the temp variable.
  98.  
  99.  
  100. Set USBDDKFolder "`Catenate "{ShellDirectory}{USBDDKFldrLocation}"`"            # Set the USBDDKFolder variable from the USBDDKFldrLocation file.
  101. Export USBDDKFolder;                                                                # Make this variable visible.
  102. Unset USBDDKFldrLocation;                                                            # Clear the USBDDKFldrLocation variable.
  103.  
  104. Set USBDDKLocalDirectory "{USBDDKFolder}";                                        # Folder of USBDDK project on local CPU.
  105. Export USBDDKLocalDirectory;
  106.  
  107.  
  108. # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  109. # Check to see if the tools folder exists. If not, warn the user.
  110.  
  111. Set USBDDKToolsFolder "{USBDDKFolder}Tools:";                            # Location of tools folder.
  112. Export USBDDKToolsFolder;
  113.  
  114. # Add the DDK tools folder to the Commands variable. We want MPW tools in our tools folder and in the current
  115. # directory to execute before tools that may exist in the MPW Tools directory.
  116.  
  117. If "{Commands}" =~ /(≈)®1{USBDDKToolsFolder},(≈)®3/                            # If the USBDDKToolsFolder is within the Commands
  118.     Set Commands "{USBDDKToolsFolder},{®1}{®3}"                                # Move it to the first item in the Commands list
  119. Else
  120.     Set Commands "{USBDDKToolsFolder},{Commands}"                            # else, it's not there so insert it to the beginning of the list.
  121. End
  122.  
  123.  
  124. # Look in the present directory first for any commands.
  125.  
  126. If "{Commands}" =~ /(≈)®1,∂:,(≈)®3/                                                # If the current directory is part of the commands
  127.     Set Commands ":,{®1},{®3}"                                                    # Move it to the top of the list.
  128. Else
  129.     Set Commands ":,{Commands}"                                                    # Else just insert it.
  130. End
  131.  
  132. Unset ®1 ®3;
  133. Execute USBDDKMPWMenu
  134.     
  135.  
  136. directory "{USBDDKFolder}" ∑∑ "{Worksheet}"
  137.  
  138. Alias USBDDK 'Execute "{USBDDKFolder}Tools:USBDDKMPWMenu"'